package com.tw.trips.domain;

import java.util.Date;
import java.util.Set;

import org.neo4j.graphdb.Direction;
import org.springframework.data.neo4j.annotation.Fetch;
import org.springframework.data.neo4j.annotation.GraphId;
import org.springframework.data.neo4j.annotation.NodeEntity;
import org.springframework.data.neo4j.annotation.RelatedTo;

@NodeEntity
public class Activity {

	@GraphId
	private Long nodeID;

	private String message;

	private Date createdOn;

	private Traveller updatedBy;

	private String imgURl;

	public String getImgURl() {
		return imgURl;
	}

	public void setImgURl(String imgURl) {
		this.imgURl = imgURl;
	}

	public Set<Comment> getComments() {
		return comments;
	}

	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}

	public Traveller getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(Traveller updatedBy) {
		this.updatedBy = updatedBy;
	}

	@RelatedTo(type = "ACTIVITIES", elementClass = Trip.class, direction = Direction.INCOMING)
	@Fetch
	private Trip trip;

	@RelatedTo(type = "ITHELPS_ACTIVITY", elementClass = ItHelps.class, direction = Direction.INCOMING)
	@Fetch
	private Set<ItHelps> itHelps;
	
	private Set<Comment> comments;

	public Activity() {
		super();
	}

	public Activity(String message, String imgURL, Date createdOn,
			Traveller updatedBy) {
		this.imgURl = imgURL;
		this.message = message;
		this.createdOn = createdOn;
		this.updatedBy = updatedBy;
	}

	public Long getNodeID() {
		return nodeID;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Date getCreatedOn() {
		return createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public Trip getTrip() {
		return trip;
	}

	public void setTrip(Trip trip) {
		this.trip = trip;
	}

	public Set<ItHelps> getItHelps() {
		return itHelps;
	}

	public void setItHelps(Set<ItHelps> itHelps) {
		this.itHelps = itHelps;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Activity [nodeID=" + nodeID + ", message=" + message
				+ ", createdOn=" + createdOn + ", updatedBy=" + updatedBy
				+ ", imgURl=" + imgURl + ", trip=" + trip + ", itHelps="
				+ itHelps + ", comments=" + comments + "]";
	}

}
